import 'package:flutter/material.dart';
import 'package:yuan_hang_app/utils/size_utils.dart';
import 'package:yuan_hang_app/widget/w_text.dart';
import '../../../../../res/w_colors.dart';
import '../../res/w_dimens.dart';
import '../../widget/status_btn.dart';
import '../../widget/w_line.dart';

/**
 * 自定义时间步骤条
 */
class DriveTimeStepper extends StatelessWidget {
  final String startTime;
  final String endTime;

  DriveTimeStepper({required this.startTime, required this.endTime});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
          padding: EdgeInsets.only(
              bottom: 5.px, left: 10.px, right: 20.px, top: WDimens.tsSmall),
          color: WColors.white,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Column(
                children: [
                  SizedBox(
                    height: 4.px,
                  ),
                  StatusBtn(
                    isBg: true,
                    color: WColors.CCCCCCC,
                    width: 10.px,
                    height: 10.px,
                    radius: 6.px,
                  ),
                  WLine(
                    height: 28.px,
                    width: 2.px,
                    color: WColors.CCCCCCC,
                  ),
                  StatusBtn(
                    isBg: true,
                    color: WColors.primaryColor,
                    width: 10.px,
                    height: 10.px,
                    radius: 6.px,
                  ),
                ],
              ),
              Expanded(
                //左边距10px
                child: Container(
                    margin: EdgeInsets.only(left: WDimens.tsMedium),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        WText(
                          "发布时间：$startTime",
                          style: TextStyle(
                              fontSize: WDimens.tsSmall,
                              color: WColors.hintTextColor),
                        ),
                        SizedBox(
                          height: 16.px,
                        ),
                        WText(
                          "有效期至：$endTime",
                          style: TextStyle(
                              fontSize: WDimens.tsSmall,
                              color: WColors.hintTextColor),
                        ),
                        SizedBox(
                          height: WDimens.tsSmall,
                        ),
                      ],
                    )),
              )
            ],
          )),
    );
  }
}
